﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QuestionnaireStatistics.aspx.cs"
    Inherits="ZX.TR.Web.QuestionnaireStatistics" ValidateRequest="false"  %>

<%@ Register Assembly="DevExpress.XtraCharts.v11.2.Web, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.XtraCharts.Web" TagPrefix="dxchartsui" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>问卷统计</title>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../Scripts/funcToExcel.js" type="text/javascript"></script>
    <link href="../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function document.oncontextmenu() {
            //event.returnValue = false; //屏蔽鼠标右键
        }
        function fnToExcel() {
            //window.open('ExportToExcel.aspx', 'newwindow', 'height=100,width=300,top=300,left=500,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
            //window.open('ExportToExcel.aspx', 'newwindow');
            ExcelFrm.submit();
        }
    </script>
    <style type="text/css">
        body{font-family: 宋体, Arial, Helvetica, sans-serif;font-size: 12px;color: #333333;background-color: #FFFFFF;}
        td { border: 1px solid #CCCCCC;}
        .textarea{width: 96%; height: 25px; }
        A:link { text-decoration: none;color: blue;}
        A:visited{text-decoration: none;color: #80006f;}
        A:hover{ text-decoration: underline;color: red;}
        .alg{text-align: center; }
        .requisite{font-family: "宋体";color: #cc0000;}
        .Header{ font-size: 14px;font-weight: bold;padding: 5px;}
        .Header tr{border:1px solid #ccc;background-color:#eee;}        
        .Header tr td {height: 30px;}
        .imgbutton{cursor:hand;filter:Alpha(Opacity=70, FinishOpacity=92, Style=2)}
        .imgbuttonhover{cursor: hand;position:relative;top:1px;left: 1px;}
        .imgbuttondisabled{cursor: wait;filter:Alpha(Opacity=60, FinishOpacity=80, Style=3) Gray }        
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div align="left" id="divMenu">
        <%--<img src="../Images/comm/mixexcellite.gif" alt="输出" width="55" height="24" border="0" align="absmiddle" class="imgbutton" onMouseOver="onMouseOverImgBtn(this)"  onMouseOut="onMouseOutImgBtn(this)" id="ExcelIB" onClick="exportToExecl();"/>--%>	    
        <img src="../Images/comm/mixexcellite.gif" alt="输出" width="55" height="24" border="0" align="absmiddle" class="imgbutton" onMouseOver="onMouseOverImgBtn(this)"  onMouseOut="onMouseOutImgBtn(this)" id="Img1" onClick="fnToExcel();"/>
    </div>
    <div>
         <div id="divReport">
        <table align="center" class="tableContent Header">
            <tr>
                <td align="right" width="70px">
                    问卷名称：
                </td>
                <td align="left" width="400px">
                    <asp:Label ID="lblQname" runat="server"></asp:Label>
                </td>
                <td align="right" width="75px">
                    发起部门：
                </td>
                <td align="left" width="100px">
                    <asp:Label ID="lblQtype" runat="server"></asp:Label>
                </td>
                <td align="right" width="95px">
                    参与调查人数：
                </td>
                <td align="left" width="75px" title="参与网上调研的总人数">
                    <asp:Label ID="lbltotalPeopleNum" runat="server"></asp:Label>
                </td>
                <td align="right" width="95px">
                    有效问卷份数：
                </td>
                <td align="left" width="75px" title="完整地回答完所有问题的参与调研中人数">
                    <asp:Label ID="lblEffectivetotalPeopleNum" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
        <br />
        <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
            <HeaderTemplate>
            </HeaderTemplate>
            <ItemTemplate>
                <table class="tableContent" >
                    <tr>
                        <td style="text-align: right; width: 75px;">
                            <asp:HiddenField ID="TrSubjectInfoID" runat="server" Value='<%#Eval("TrSubjectInfoID")%>'>
                            </asp:HiddenField>
                            <asp:HiddenField ID="TrQuestionnaireSubjectID" runat="server" Value='<%#Eval("TrQuestionnaireSubjectID")%>'>
                            </asp:HiddenField>
                            题目内容：
                        </td>
                        <td style="text-align: left;">
                            <%#Eval("sequence") %>.<%#Eval("SubjectContent")%>
                            【
                            <asp:Label ID="lblType" runat="server" Text='<%#Eval("SubjectType")%>'></asp:Label>
                            】
                            <asp:HyperLink ID="lnkOpen" runat="server" NavigateUrl="" Target="_blank" Visible="false">查看调研结果</asp:HyperLink>
                        </td>
                        <td style="text-align: left; width: 40%;" rowspan="2" id="tdWebChartControl">
                            <div id="divChart">
                                <dxchartsui:WebChartControl ID="charSubjectInfo" runat="server" Width="500px" Visible="false">
                                </dxchartsui:WebChartControl>
                            </div>
                        </td>
                    </tr>
                    <asp:Panel ID="plselectQusetion" runat="server" Visible="false">
                    <tr style='display: <%#((Eval("SubjectType").ToString()=="单选题")||(Eval("SubjectType").ToString()=="多选题"))?"":"none"%>'>
                        <td style="text-align: right">
                            选项内容：
                        </td>
                        <td style="text-align: left">
                            <asp:Repeater ID="rptItem" runat="server">
                                <HeaderTemplate>
                                    <table width="99%">
                                        <tr>
                                            <td>
                                                选项
                                            </td>
                                            <td style="text-align: left; width: 450px;">
                                                内容
                                            </td>
                                            <td>
                                                小计
                                            </td>
                                            <td>
                                                比例
                                            </td>
                                        </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <%#Eval("ItemCode")%>
                                        </td>
                                        <td>
                                            <%#Eval("SunjectItem")%>
                                        </td>
                                        <td>
                                            <%#Eval("totalCount")%>
                                        </td>
                                        <td>
                                            <%#Eval("EffectivePercent")%>%
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                    </asp:Panel>
                    <asp:Panel ID="plpdt" runat="server" Visible="false">
                    <tr>
                        <td style="text-align: right">
                            选项内容：
                        </td>
                        <td style="text-align: left">
                            <table width="99%">
                                <tr>
                                    <td>
                                        选项
                                    </td>
                                    <td>
                                        小计
                                    </td>
                                    <td>
                                        比例
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        对
                                    </td>
                                    <td>
                                        <%# GetCount(Eval("TrSubjectInfoID").ToString(),"对")%>
                                    </td>
                                    <td>
                                        <%# GetCountPercent(Eval("TrSubjectInfoID").ToString(), "对")%>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        错
                                    </td>
                                    <td>
                                        <%# GetCount(Eval("TrSubjectInfoID").ToString(), "错")%>
                                    </td>
                                    <td>
                                        <%# GetCountPercent(Eval("TrSubjectInfoID").ToString(), "错")%>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    </asp:Panel>
                    <asp:Panel ID="plEssayQuestionItem" runat="server" Visible="false">
                    <tr>
                        <td style="text-align: left" colspan="2">
                            <asp:Repeater ID="rptEssayQuestionItem" runat="server" >
                                <HeaderTemplate>
                                    <table width="99%">
                                        <tr>
                                            <td style="text-align: left;width:50px;"> 序号</td>
                                            <td style="text-align: left;width:450px;" colspan="3">答案</td>
                                        </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td> 
                                        <%#Eval("RowNum")%>
                                        </td>
                                        <td colspan="3"> <%#Eval("Answer")%></td>
                                    </tr>                         
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                    </asp:Panel>
                    <tr>
                        <td colspan="4" style="border:0">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <FooterTemplate>
            </FooterTemplate>
        </asp:Repeater>
        </div>
    </div>
    <div id="ExcelTitleDiv" style="display:none" ></div>
    <div id="ExcelDiv" style="display:none" ></div>
    </form>
</body>
</html>
<form action="ExportToExcel.aspx" method="post" id="ExcelFrm" name="ExcelFrm" target="_blank">
    <input id="fileName" name="fileName" value="<%=questionnaireName %>_结果统计"  type="hidden"/>
</form>

